package pl.edu.agh.iosr.ftpserverremote.iprestrictor;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.SQLWarning;
import java.sql.Statement;

/**
 * 
 * @author Tomasz Sadura
 *
 */
public class FakeStatement implements Statement {

  private final String[][] data;

  public FakeStatement(final String[][] data) {
    this.data = data;
  }

  public ResultSet executeQuery( final String query ) {
    if ( query.indexOf( "Server" ) != -1 ) {
      return new FakeRowSet( new String[0][0] );
    }
    else {
      return new FakeRowSet( data );
    }
  }

  public void addBatch( final String sql ) throws SQLException {

  }

  public void cancel() throws SQLException {

  }

  public void clearBatch() throws SQLException {

  }

  public void clearWarnings() throws SQLException {

  }

  public void close() throws SQLException {

  }

  public boolean execute( final String sql ) throws SQLException {
    return false;
  }

  public boolean execute( final String sql, final int autoGeneratedKeys ) throws SQLException {
    return false;
  }

  public boolean execute( final String sql, final int[] columnIndexes ) throws SQLException {
    return false;
  }

  public boolean execute( final String sql, final String[] columnNames ) throws SQLException {
    return false;
  }

  public int[] executeBatch() throws SQLException {
    return null;
  }

  public int executeUpdate( final String sql ) throws SQLException {
    return 0;
  }

  public int executeUpdate( final String sql, final int autoGeneratedKeys )
      throws SQLException
  {
    return 0;
  }

  public int executeUpdate( final String sql, final int[] columnIndexes ) throws SQLException {
    return 0;
  }

  public int executeUpdate( final String sql, final String[] columnNames ) throws SQLException
  {
    return 0;
  }

  public Connection getConnection() throws SQLException {
    return null;
  }

  public int getFetchDirection() throws SQLException {
    return 0;
  }

  public int getFetchSize() throws SQLException {
    return 0;
  }

  public ResultSet getGeneratedKeys() throws SQLException {
    return new FakeRowSet( new String[1][1] );
  }

  public int getMaxFieldSize() throws SQLException {
    return 0;
  }

  public int getMaxRows() throws SQLException {
    return 0;
  }

  public boolean getMoreResults() throws SQLException {
    return false;
  }

  public boolean getMoreResults( final int current ) throws SQLException {
    return false;
  }

  public int getQueryTimeout() throws SQLException {
    return 0;
  }

  public ResultSet getResultSet() throws SQLException {
    return null;
  }

  public int getResultSetConcurrency() throws SQLException {
    return 0;
  }

  public int getResultSetHoldability() throws SQLException {
    return 0;
  }

  public int getResultSetType() throws SQLException {
    return 0;
  }

  public int getUpdateCount() throws SQLException {
    return 0;
  }

  public SQLWarning getWarnings() throws SQLException {
    return null;
  }

  public void setCursorName( final String name ) throws SQLException {

  }

  public void setEscapeProcessing( final boolean enable ) throws SQLException {

  }

  public void setFetchDirection( final int direction ) throws SQLException {

  }

  public void setFetchSize( final int rows ) throws SQLException {

  }

  public void setMaxFieldSize( final int max ) throws SQLException {

  }

  public void setMaxRows( final int max ) throws SQLException {

  }

  public void setQueryTimeout( final int seconds ) throws SQLException {

  }

  public boolean isClosed() throws SQLException {
    throw new UnsupportedOperationException( "Not supported yet." );
  }

  public void setPoolable( final boolean poolable ) throws SQLException {
    throw new UnsupportedOperationException( "Not supported yet." );
  }

  public boolean isPoolable() throws SQLException {
    throw new UnsupportedOperationException( "Not supported yet." );
  }

  public <T> T unwrap( final Class<T> iface ) throws SQLException {
    throw new UnsupportedOperationException( "Not supported yet." );
  }

  public boolean isWrapperFor( final Class<?> iface ) throws SQLException {
    throw new UnsupportedOperationException( "Not supported yet." );
  }

}
